package com.study.talk.ui.app.login

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.study.talk.data.model.UserInfo
import com.study.talk.netty.message.response.LoginResponse

class LoginViewModel : ViewModel() {
    private val _loginResponse = MutableLiveData<LoginResponse>()
    val loginResponse: LiveData<LoginResponse> get() = _loginResponse

    fun changeResponse(loginResponse: LoginResponse) {
        _loginResponse.postValue(loginResponse)
    }

    fun changUserInfo(userInfo: UserInfo) {
        loginResponse.value?.let {
            it.userInfo = userInfo
            _loginResponse.postValue(it)
        }
    }
}